<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="UTF-8">
  <title>首页</title>
    <link href="/css/bootstrap.css" rel="stylesheet">
</head>
<body>
<!-- 导航栏-->
<div th:fragment="nav">
    <div style="border: 2px darkred solid;" >
        <h3 align="center">学生成绩简易系统-2024.10.28</h3>
        <div style="display: flex; justify-content: space-between">
            <!--<p th:text="${session.user}"></p>-->
            <h4><a href="/home/main">学生成绩简易系统-首页</a></h4>
            <div  style="width: 50%;display: flex; justify-content: space-between; padding-top: 12px">
                <p style="color: brown" th:if="${session.user == null}">
                    未登录
                </p>
                <p style="color: blue" th:if="${session.user != null}">
                    <!-- private String uname;-->
                    姓名: <span th:text="${session.user.uname}"></span>
                </p>
                <p style="color: blueviolet" th:if="${session.user != null && session.user.role == 'stu'}">
                    角色:  <span>学生</span>
                </p>
                <p style="color: blueviolet" th:if="${session.user != null && session.user.role == 'tea'}">
                    角色:  <span>教师</span>
                </p>
                <p style="color: blueviolet" th:if="${session.user != null && session.user.role == 'adm'}">
                    角色:  <span>教务处</span>
                </p>
                <p style="color: blue"><a href="/home/logout"><button class="btn">退出</button> </a></p>
                <p style="margin-top: -3vw; width: 5vw; height: 5vw">
                    <img th:src="'/public/img/' + ${session.user.pic}" style="width: 100%;height: 100%" th:if="${session.user != null}">
                </p>
                <p>&nbsp;</p>
            </div>
        </div>
        <hr>
    </div>
</div>
<!-- 导航栏结束-->

<!--登录和功能菜单-->
<div  style="display: flex;justify-content: center;">
  <!--登录-->
  <div th:if="${session.user == null}" style="min-height:500px;width:70%;display: flex;flex-direction: column;align-items: center;">
      <br>
      <br>
    <h3>登录</h3>
      <hr>
      <table class="table" style="text-align: center;width: 50%"border="1px solid black">
          <form action="/home/login" method="post">
        <tr>
          <td>手机号：</td>
          <td><input name="phone" type="text"></td>
        </tr>
        <tr>
          <td>密码：</td>
          <td><input name="pwd" type="password"></td>
        </tr>
        <tr>
          <td></td>
            <td><button class="btn btn-warning" value="登录">登录</button></td>
        </tr>
          </form>
      </table>

      <br>
      <br>
      <br>
      <span style="color: red;font-size: 2vh" th:text="${state}"></span>
  </div >
  <!--菜单-->
  <div th:if="${session.user != null}" style="min-height:500px;width:70%;display: flex;flex-direction: column;align-items: center;">
      <h3>菜单
          &nbsp;&nbsp;&nbsp;&nbsp;
          &nbsp;&nbsp;
          <span style="font-size: 1.5vh">操作状态：
          <span style="color: red;font-size: 2vh" th:text="${state}" th:if="${state != null}"></span>
          <span style="color: red;font-size: 2vh" th:if="${state == null}">操作ing</span></span></h3>
      <hr>

      <div style="width: 60%">
          <div th:if="${session.user != null && session.user.role == 'stu'}">
              <h3>学生系统-成绩查询</h3>
              <div>
                  <ul style="list-style: square">
                      <li><a href="/stu/go2Update">修改密码</a></li>
                      <hr>
                      <li><a href="/stu/myCourse">我的课程查询-我所在班级的课程表-有点难</a></li>
                      <hr>
                      <li><a href="/stu/markInfo">我的成绩查询 - 有点难-没有做成绩录入的可以造数据</a></li>
                  </ul>
              </div>
          </div>
          <div th:if="${session.user != null && session.user.role == 'tea'}">
              <h3>任课教师系统-教师登分</h3>
              <div>
                  <ul style="list-style: square">
                      <li><a href="/tea/go2Update">修改密码</a></li>
                      <hr>
                      <li><a href="/tea/doMain">登分管理及课程查询-难-挑战题</a></li>
                  </ul>
              </div>
          </div>
          <div th:if="${session.user != null && session.user.role == 'adm'}">
              <h3>管理员系统-班级课程学生</h3>
              <div>
                  <ul style="list-style: square">
                      <li><a href="/adm/clz/prevPage">班级管理</a></li>
                      <li><a href="/adm/course/prevPage">课程管理</a></li>
                      <hr>
                      <li><a href="/adm/stu/prevPage">学生管理</a></li>
                      <li><a href="/adm/tea/prevPage">教师管理</a></li>
                      <hr>
                      <li><a href="/adm/task/show">安排教师到班级去上课-有点难</a></li>
                  </ul>
              </div>
          </div>
      </div>

  </div>
</div>
</body>
</html>